home *** CD-ROM | disk | FTP | other *** search
/ MacHack 1996 / MacHack 1996.toast / Presentations / Presentations ’91 / DAL Files / DALtool 4⁄19 (System 6.x) / DalDemoInits.c < prev    next >
C/C++ Source or Header  |  1991-04-20  |  2KB  |  66 lines

  1. #include <QuickDraw.h>
  2. #include <MacTypes.h>
  3. #include <WindowMgr.h>
  4. #include <TextEdit.h>
  5. #include <ControlMgr.h>
  6. #include <EventMgr.h>
  7. #include "DalDemo.h"
  8.  
  9. extern MenuHandle    gAppleMenu, gFileMenu, gEditMenu;
  10. extern Rect    gDragRect;
  11. extern DialogPtr    gLogonDialog;
  12. extern Boolean gDone, gWNEImplemented, gDALActive, gDALMonitor, gDALNewCodeFrag;
  13. extern long gTimer, gCounter;
  14. extern int gDALState;
  15.  
  16. /*** ToolBoxInit ***/
  17. ToolBoxInit()
  18. {
  19.     InitGraf( &thePort);
  20.     InitFonts();
  21.     FlushEvents(everyEvent,REMOVE_ALL_EVENTS);
  22.     InitWindows();
  23.     InitMenus();
  24.     TEInit();
  25.     InitDialogs(NIL);
  26.     InitCursor();
  27. }
  28.  
  29. /***GlobalVarInit***/
  30. void GlobalVarInit()
  31. {
  32.     gDone = FALSE;
  33.     gWNEImplemented = (NGetTrapAddress( WNE_TRAP_NUM, ToolTrap) !=
  34.         NGetTrapAddress( UNIMPL_TRAP_NUM, ToolTrap));
  35.  
  36.     gTimer = TickCount();
  37.     gCounter = 0L;
  38.     gDALState = 0;
  39.     gDALActive = FALSE;
  40.     gDALMonitor = FALSE;
  41.     gDALNewCodeFrag = FALSE;
  42. }
  43.  
  44. /*** MenuBarInit ***/
  45. MenuBarInit()
  46. {
  47.     Handle myMenuBar;
  48.     
  49.     if ((myMenuBar = GetNewMBar(RSRC_BASE)) == NIL) ErrorHandler(NO_MBAR);
  50.     SetMenuBar(myMenuBar);
  51.     if ((gAppleMenu = GetMHandle(APPLE_MENU_ID)) == NIL) ErrorHandler(NO_MENU);
  52.     AddResMenu(gAppleMenu, 'DRVR');
  53.     if ((gFileMenu = GetMHandle(FILE_MENU_ID)) == NIL) ErrorHandler(NO_MENU);
  54.     if ((gEditMenu = GetMHandle(EDIT_MENU_ID)) == NIL) ErrorHandler(NO_MENU);
  55.     DrawMenuBar();
  56. }
  57.  
  58. /*** SetUpDragRect ***/
  59. SetUpDragRect()
  60. {
  61.     gDragRect = screenBits.bounds;
  62.     gDragRect.left += DRAG_THRESH;
  63.     gDragRect.right -= DRAG_THRESH;
  64.     gDragRect.bottom -= DRAG_THRESH;
  65. }
  66.